export function isImageFile(fileName) {
  let fileArr = fileName.split(".")
  if (fileArr.length < 2) return false
  let suffix = fileArr[fileArr.length - 1]
  let imgList = ['png', 'jpg', 'jpeg', 'bmp', 'gif', 'webp']
  let result = imgList.some(item => item == suffix)
  return result;
}

export function charToUnicode(str) {
  let temp;
  let i = 0;
  let r = '';
  for (let val of str) {
    temp = val.codePointAt(0).toString(16);
    while (temp.length < 4) temp = '0' + temp;
    r += '\\u' + temp;
  }
  return r;
}
